package com.llkj.safeearth.httpUtils;

import android.content.Context;

import com.yayandroid.locationmanager.helper.StringUtils;

import java.util.HashMap;

/**
 * 如果参数少于3个就直接传入value，如果多于3个就直接出入map
 */
public class HttpMethod {
    //
    public static final String HOME_INDEX = "http://47.88.46.214/index.php?r=app/login/login";
    private static final String ROOT_URL = "http://47.88.46.214/index.php?r=app/homepage/";
    /**
     * 1.1 注册
     */
    public static final String LOGIN_REGISTER = ROOT_URL + "location";
    public static final int HTTP_LOGIN_REGISTER = 100011;

    public static void updataeLocation(Context mContext, AnsynHttpRequest.ObserverCallBack callback,String uid,String lat, String lng,String type) {
        HashMap<String, String> params = new HashMap<String, String>();
        params.put("lat", lat);
        params.put("lon", lng);
        params.put("user_id", uid);

        if(!StringUtils.isEmpty(type)){
            params.put("type", type);
        }

        AnsynHttpRequest.requestGetOrPost(mContext, AnsynHttpRequest.GET, LOGIN_REGISTER, params, callback, HTTP_LOGIN_REGISTER);
    }

}
